<template>
    <div>
        <Row type="flex" justify="center">
            <Col span="6" v-for="(item,index) in defaultList">
               <div @click='choosePhtos(item)' class=image-item>
                    <Card>
                    <p slot="title">{{item.img_type}}</p>
                    <div>
                        <img :src="item.img_url" :alt="item.img_title" :title="item.img_title">
                    </div>  
                   </Card>
               </div>
            </Col>
        
        </Row>
    </div>
</template>
<style scoped src="../../../../static/css/backend/photo/index.css"></style>

<script>
    export default {
        data () {
            return {
                defaultList: [
                ],
        
            }
        },
        mounted () {
               this.getPhotoList();
        },
        methods: {
             getPhotoList(){
                   let that = this;
                this.fetch({
                    url: '/photos', //1为获取type
                    method: 'GET',
                    params: {

                    }
                }).then(function (response) {
                     that.defaultList = response.data.rows;
                });
             },
             choosePhtos(item){
                 console.log(4444);
                     this.$router.push({path:'/photoItem?photo_id='+item.id});  
             }
        }
    }
</script>